package cn.lu.joke.ui.mine.fragment;

import android.content.Intent;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.OnClick;
import cn.lu.joke.App;
import cn.lu.joke.GlideApp;
import cn.lu.joke.R;
import cn.lu.joke.api.API;
import cn.lu.joke.base.BaseFragment;
import cn.lu.joke.entry.ResultData;
import cn.lu.joke.entry.User;
import cn.lu.joke.mvp.presenter.user.IMinePresenter;
import cn.lu.joke.mvp.presenter.user.MinePresenterImpl;
import cn.lu.joke.mvp.view.IUserView;
import cn.lu.joke.ui.dialog.ImageDialog;
import cn.lu.joke.ui.mine.activity.SettingActivity;
import cn.lu.joke.ui.mine.activity.UserInfoActivity;
import cn.lu.joke.util.Toast;

public class MineFragment extends BaseFragment implements IUserView.IMineView{

    @BindView(R.id.tv_follow)
    TextView mTvFollow;
    @BindView(R.id.tv_fans)
    TextView mTvFans;
    @BindView(R.id.tv_interval)
    TextView mTvInterval;
    @BindView(R.id.tv_praise)
    TextView mTvPraise;
    @BindView(R.id.civ_header_view_mine)
    ImageView mIvHeadImg;
    @BindView(R.id.rv_mine)
    RecyclerView mRecycleView;


    private IMinePresenter minePresenter;

    @Override
    protected int getLayout() {
        return R.layout.fragment_mine;
    }

    @Override
    protected void initView() {
        minePresenter = new MinePresenterImpl(this);
    }

    @Override
    public void initData() {
    }

    @Override
    public void onVisible() {
        if (App.getLoginUser() != null) {
            loadHeadImage(App.userHeadImage());
        }
    }

    private void loadHeadImage(String headImgUrl) {
        GlideApp.with(getActivity())
                .asDrawable()
                .skipMemoryCache(true)
                .load(API.baseUrl_noRod + headImgUrl)
                .into(mIvHeadImg);
    }

    @Override
    public void onMineInfo(ResultData<User> data) {

    }

    @Override
    public void onLoading() {

    }

    @Override
    public void onError(Throwable e) {

    }

    @Override
    public void onComplete() {

    }
}
